
package com.htd.htdapmcommon.enums;


public enum AlarmsStatusEnum {
    ALARM_TRIGGER("trigger","触发告警"),
    ALARM_RESOLVE("resolve","解决告警"),
    
	ACTIVE("ACTIVE","未关闭"),
	ACK("ACK","已确认"),
	CLOSED("CLOSED","已关闭");

	private String code;

	private String msg;

	private AlarmsStatusEnum(String code, String msg){
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

    /**
     * 根据code获取去value
     * @param code
     * @return
     */
    public static String getValueByCode(String code){
        for(AlarmsStatusEnum alarmsStatusEnum:AlarmsStatusEnum.values()){
            if(code.equals(alarmsStatusEnum.getCode())) {
                return alarmsStatusEnum.getMsg();
            }
        } return null;
    }
}
